# usage nuke_format format_name
SED=$(which gsed)
-EDITOR="${EDITOR:-vim}"
+EDITOR="${EDITOR:-vim}"
+
+# $1 = format $2 = file in all functions
+
-# $1 = format $2 = file
remove_word() {
# git add $2
- $SED -i "s/$1//g" $2
+set -x
+ # This uses a GNU extension ? for zero or more, letting us match with last
+ # entry in a line which has no following whitespace
+ $SED -i "s/$1\s*//g" $2
}
remove_line_containing() {
remove_manually $1 reference/help.txt
-remove_line_containing $1 reference/format0.txt
-remove_line_containing $1 reference/format1.txt
-remove_line_containing $1 reference/format2.txt
-remove_manually $1 reference/format3.txt
+# Take out the boilerplate entries in vecs.h ...
remove_line_containing extern.*$1 vecs.h
remove_line_containing Format.*$1 vecs.h
remove_line_containing include.*$1 vecs.h
-remove_manually $1 reference/format3.txt
+# ... then let a human nerd snip3 the actual table entry awy
+remove_manually $1 vecs.h
+
+remove_line_containing $1 reference/format0.txt
+remove_line_containing $1 reference/format1.txt
+remove_line_containing $1 reference/format2.txt
+# This breaks these, but at least it leaves a clue in version history.
remove_line_containing $1 msvc/GPSBabel.vcxproj
remove_line_containing $1 msvc/GPSBabel.vcxproj.filters
git rm -f xmldoc/formats/$1.xml
git rm -f xmldoc/formats/options/$1.xml
git rm -f testo.d/$1.test
-git rm -f $1.cc
-git rm -f $1.h
+git mv $1.cc deprecated/
+git mv $1.h deprecated/
# make && ./testo
--- /dev/null
+# Temporary script to undo what
+
+rm reference/format?.txt reference/help.txt
+# git rm reference/format?.txt reference/help.txt
+git reset reference/format?.txt reference/help.txt
+git checkout reference/format0.txt
+git checkout reference/format1.txt
+git checkout reference/format2.txt
+git checkout reference/format3.txt reference/help.txt
+
+rm GPSBabel.pro vecs.h vecs.cc
+# git rm GPSBabel.pro vecs.h
+#git reset GPSBabel.pro
+#git reset vecs.h
+git checkout GPSBabel.pro vecs.h vecs.cc
+
+# This part of the code devalues almot immediately once pushed upstream
+echo "Now re-killing formats to exercise the script. ^C to cancel. <enter> to ontinue"
+read x
+
+for f in compegps cst destinator g7to2in gopal gpsutil jtr maggeo mapsend nm4 pcx pocketfms skyforce stmsdf stmwpp tiger vpl wfff yahoo
+do
+ git checkout $f.cc $f.h
+ tools/nuke_format $f
+done
+
+# nuke_format is also believed to work on:
+# gpsutil destinator exif gopal gpsutil jogmap jtr maggeo
+# mapsend pcx skyforce stmsdf stmwpp tiger vidaone vpl yahoo
+